/*
 * @Author: zyp yangpeng.zhang@fts.aero
 * @Date: 2024-05-29 15:31:11
 * @LastEditors: zyp yangpeng.zhang@fts.aero
 * @LastEditTime: 2024-06-28 10:38:06
 * @FilePath: \vue3-dynamic-module\src\modules\Music\index.ts
 * @Description: 程式描述
 */
import music from './index.vue';
import Icon from './icon.svg?component';

export default {
  config: {
    name: 'Music',
    ref: markRaw(music),
    position: 'FOOTER_TABBAR',
    type: 'PAGE',
    sort: 1,
    icon: markRaw(Icon),
    path: '/music',
  },
  install(app: any, options?: any) {
    console.log('注册-音乐-模块', options)
    // options.router.addRoute('Home', {
    //   path: 'music',
    //   name: this.config.name,
    //   meta: { title: '音乐', keepAlive: true, icon: '' },
    //   component: music
    // });
    // options.router.addRoute({
    //   path: this.config.path,
    //   component: options.Layout,
    //   meta: { title: '音乐', icon: '', },
    //   name: 'Music',
    //   children: [
    //     {
    //       path: '',
    //       meta: { title: '音乐', keepAlive: true, icon: '' },
    //       name: "MusicMain",
    //       component: music
    //     },
    //   ]
    // });
    app.config.globalProperties[`MusicRouterTree`] = {
      path: this.config.path,
      component: options.Layout,
      meta: { title: '音乐', icon: '', },
      name: 'Music',
      children: [
        {
          path: '',
          meta: { title: '音乐', keepAlive: true, icon: '' },
          name: "MusicMain",
          compurl: './Music/index.vue',
          component: music
        },
      ]
    };
    app.component(this.config.name, music);
  }
}
